<?php

namespace Bliss\IncidentBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Incident
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Bliss\IncidentBundle\Entity\IncidentRepository")
 */
class Incident
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="commentaire", type="string", length=255)
     */
    private $commentaire;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="dateDetection", type="date")
     */
    private $dateDetection;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="dateResolution", type="date")
     */
    private $dateResolution;

      
    /**
     *
     * @ORM\ManyToOne(targetEntity="Bliss\ParcBundle\Entity\Machine", inversedBy="incidents")
     */
    private $machine;
    
    /**
     *
     * @ORM\ManyToOne(targetEntity="Bliss\IncidentBundle\Entity\TypeIncident", inversedBy="incidents")
     */
    private $typeIncident;


    
    
    
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set commentaire
     *
     * @param string $commentaire
     * @return Incident
     */
    public function setCommentaire($commentaire)
    {
        $this->commentaire = $commentaire;
    
        return $this;
    }

    /**
     * Get commentaire
     *
     * @return string 
     */
    public function getCommentaire()
    {
        return $this->commentaire;
    }

    /**
     * Set dateDetection
     *
     * @param \DateTime $dateDetection
     * @return Incident
     */
    public function setDateDetection($dateDetection)
    {
        $this->dateDetection = $dateDetection;
    
        return $this;
    }

    /**
     * Get dateDetection
     *
     * @return \DateTime 
     */
    public function getDateDetection()
    {
        return $this->dateDetection;
    }

    /**
     * Set dateResolution
     *
     * @param \DateTime $dateResolution
     * @return Incident
     */
    public function setDateResolution($dateResolution)
    {
        $this->dateResolution = $dateResolution;
    
        return $this;
    }

    /**
     * Get dateResolution
     *
     * @return \DateTime 
     */
    public function getDateResolution()
    {
        return $this->dateResolution;
    }
    
    
    public function getMachine()
    {
        return $this->machine;
    }
    
    public function setMachine(\Bliss\ParcBundle\Entity\Machine $machine)
    {
        
        $this->machine = $machine;
        return $this;
    }
    
    public function getTypeIncident()
    {
        return $this->typeIncident;
    }
    
    public function setTypeIncident(\Bliss\IncidentBundle\Entity\TypeIncident $typeIncident)
    {
        $this->typeIncident = $typeIncident;
        return $this;
    }
    
    
    
    
    public function __toString() {
        return $this->typeIncident . " : ".$this->commentaire;
    }
}
